Index
Glossary Terms


(also called cli, command line interface, command prompt, terminal)
A very basic interface allowing input and output. Examples include the Linux console and Windows command prompt.
Also see opening the console....
Usage:
1) Used for program output especially during development, testing and debugging.
2) Used by coders to do file-based tasks such as configuring, downloading, uploading, etc.
An object type (e.g. class) is a single definition like Person, Car, Ball, Rectangle, ... From the one definition we can construct many object instances. Many object languages use class interchangeably with object type. More:
The purpose of a constructor (method) is to simplify the construction of object instances from the given class.
A constructor will often initialize ivars.
More:
(also called instance or object instance)
From a given object type, we construct what we call object instances. From one "Person" object type we construct Person instances like Riya, Asha, Chin, Bruce, etc.
More:
(or part, ivar, child)
A super important concept.
Details:
An instance variable (ivar) is a variable defined on a class. All instance methods in the given class have access to ivars.

See this reference: ivar concept sketches and explanation of 'this'....

The prefix instance is used because each object instance has it's own ivar.

A given object instance "owns" its ivars.

Note that ivars may also be referred to as properties, components, parts, children, etc.
Almost all oop code is written in "instance methods".

An instance method is a method that is applicable to an object instance in the running code.

So if we have three object instances a, b and c (of type Rectangle) with widths 10, 20 and 30 respectively. Then:
  • When we send "getWidth" to "a" we should receive the value 10
  • Sending "getWidth" to "b" produces 20
  • Sending "getWidth" to "c", produces 30

The trick is, when you are coding to think "object instance". And you refer to that object instance generally as this.

See more under this.
The keyword 'this' is used a lot in object coding.

When coding an instance method, we are actually writing code that applies to an object instance that will exist at runtime.

More details:


Note: In some languages we use "self" rather than "this" (or another team could be used).
Object-oriented-programming. Coding with an object approach. (classes and objects). Supported by JavaScript, Python, Java, Smalltalk, and many others.
An integrated development environment (IDE) is used by coders to write and manage code.
There are minimal IDE's such as:
  • Notepad++ (Windows)
  • Notepadqq (Unix)
There are more sophisticated IDE's such as:
  • IntelliJ
  • Eclipse
When learning to code, a minimal IDE is the best choice. Then, when you start solving more complex problems, move to a more powerful IDE.
In oop, a method override is when a method is implemented in a (child) sub-type that is declared in a (parent) super-type.
Example where sub-type B overrides super-type A's method 'foo()':
A
	foo()
B (has super-type A)
	foo()
Supported in some oop languages.
Is the case where the same method name is declared multiple times in one type/class.
Example where type "List" declares two "add" methods (each with different method params):
List
	add(Object o)
	add(List otherList)
A common test method:
 assertEquals(expectedValue, actualValue)

Example (this test would pass)
actual = "Hello";
assertEquals("Hello", actual)

Example (this test would fail)
actual = 11;
assertEquals(10, actual)
Like assertEquals except we are asserting that the actual value is not equal to the expected value.
A common test method:
 assertNotEquals(expectedValue, actualValue)

Example (this test would pass)
actual = "Hello";
assertNotEquals(null, actual)
A smoke test is done to test basic functionality.
We're basically making sure our code does not blow up (throw exceptions) immediately (upon use).
Also see:
Code that tests code. Letting the computer (code we write) do the hard work of verifying and finding bugs.
Placeholder or parameter. A "slot" for a value.
See more here
The principle Keep it simple, silly aims at simplicity over complexity. A complex solution is often the easy one (also called "brute force") while a simple solution takes more thought. We strive for simple.
Broadly speaking, the primitive data type includes numbers, booleans and in some cases strings. Compare:
  • primitive value (prim) - raw data only (e.g. 10.5, 101, "foo")
  • object - can have structure (instance variables) and behavior (methods). E.g. Car, Array, Map,Rectangle -- anything that is not a prim.
More details here:
A super helpful operator that most languages support. Generally it goes something like this:
 result = <condition> ? <result for true> : <result for false>

Examples:
result = (5 > 3) ? "yes" : "no"
//yes
result = ("foo".equals("boo")) ? 100 : 0
//0
(or arg, parameter, method parameter, method params, argument, method argument, variable, function arg, ...)
In essence, a param is a variable. In object coding, often "param" will imply "method param" (the parameters passed to a given method). Here are a couple examples:
//Java syntax (param "aWidth")
setWidth(int aWidth)

//JavaScript syntax (params "firstNm", "lastNm")
setName(firstNm, lastNm)
Before discussing "implicit ivars", we want to first get a good understanding of basic ivars.

Generally coding languages require that we explicitly declare ivars. Some languages do not require this, but rather use implicit ivars that are simply added to the object instance when assigned in a method as shown below.

The important thing is that in both examples below, a Dog object instance would own an ivar "name" and "age". Note we use other names for ivars like properties, components, etc.

//Declared ivars in Java:
public class Dog {
	private String name;
	private int age;
	//...
}

//Implicit ivars in JavaScript:
class Dog {
	constructor(aNm, aAge) {
		this.name = aName;
		this.age = aAge;
	//...
}
A "undefined guard" or "null guard" guards against using undefined values in your program (notorious for causing bugs that will crash the program). The actual type guarded against varies by language. The algorithm for such a guard is something like:
Assumption for example: Guard against "undefined"
Given: value, defaultValue
Is value is "undefined", then return defaultValue
Else return value
A method that you code that you can then call from one or more other methods. Add these helpers liberally and freely. A couple of reasons for helper methods are:
  • To simplify the calling method (shorter methods are better)
  • You may end up calling the helper from multiple other methods (code reuse)

We could also call these "buddy methods", "support methods", "other methods", etc. (just a label -- up to you).

See The Disappearing Code Blob Magic Trick
A value type that can be true or false. It is the "driver" of programs, as boolean value control how programs flow.
Logic is making a decision based on a true or false condition.
A question that results in a boolean (true/false).
A statement that uses a condition (true/false) to drive program flow.
js is abbreviation for JavaScript.
(scope)
In coding, the current "context" is the environment where you are currently coding. It defines what objects and methods are available to use.

See details:
An idea. A concept. Not a "real" thing. Not operationally usable. Describes operations (methods) that can be performed (but now how to perform them).
An actual thing. Reality. Yes is operationally usable.
A working directory (wd) is simply a computer directory where we work (locate our files and sub-directories) for a given coding exercise/project/etc.
See this page for more details and gotchas:
(mutation)
A mutable value or object is one that can be changed.
A immutable value or object is one that can not can be changed.
In coding we use the terms "add" or "append" interchangeably to mean we are "appending" an element to a list.
Given a list [10, 20, 30, 40] if we add 100 to the list our new list is [10, 20, 30, 40, 100].
Abbreviation "fp" for functional programming.
Here is a simple definition: wiki.
When beginning, we can think of fp as function-oriented programming (like how we think of oop).
The web is loaded with information if interested in diving deeper. Here is a nice write-up....
An algorithm (recipe) is a solution to a problem written in human-readable pseudocode as opposed to computer program code.
The format/style of the recipe (how it is written) is your choice.
See more here:
Pseudocode means "almost-code". It is human readable.
Below is an example of printing the numbers 1-10.
In the example we assume "println" prints a value.
let number = 0;
while (number <= 10) {
	println(number);
	number++;
}
A car object sends the message "start" to an engine component object.

The car is the sender.

The engine is the receiver.

Also see Concepts of Messages
Sender
class Car {
	startCar() {
		this.engine.startEngine();
	}
}
Receiver
class Engine {
	startEngine() {
		this.igniteCombustion();
	}
}
Lexical scope (or static scope) sounds a bit fancy, but it's an intuitive type of scope.

It means the scope in the function includes the scope outside the function (in addition to local scope).

Example 1
Here is a js example.

The "this" inside the function (the "inner this") is equal to the "outer this".
let fct, outerThis;
outerThis = this;
fct = () => {
	return (this === outerThis);
}
prn("Context in function equals outer: " + fct());
//Context in function equals outer: true
Example 2
In this example we access (call) the (outer) instance method "increment" from (inside) the function.
class LexicalExample {
	constructor() {
		this.count = 0;
	}
	increment() {
		this.count++;
	}
	demo() {
		const fct = () => {
			this.increment();
		};
		console.log("Before: " + this.count);
		//0
		fct();
		fct();
		console.log("After: " + this.count);
		//2
	}
}
(new LexicalExample()).demo();
Local scope is limited to just the local code block (e.g. method/function).

Example 1
The local scope (inside this function) consists of vars "a" and "b".

These vars are only accessible from within the function.

Generally scope also includes "globals".
function play() {
	const a = 10;
	const b = 5;
	console.log(a + b);
}
user interface (computer screen, phone, keypad, keyboard, mouse, ...)
url
{-- The five components of a uniform resource locator (url):

⚠️ keep it simple warning -- different sources could use different terminology -- don't get hung up on that.

https://www.abc.com/shapes/rectangle?width=10&height=2#conclusion


ComponentExampleAlso Called
schemehttpsprotocol
hostwww.abc.comserver id or domain name
path/shapes/rectangleor folder name + web filename
querywidth=10&height=2query params or search params
fragment identifierconclusionfragment - often used to "go to" a section heading within a page.
Caching is temporary/intermediate data storage for the purpose of optimization.

In web coding, caching is often on the client while the "real" data would stored on the web server / database.
(code reuse or logic reuse)
We always strive to reuse existing (finished) logic that is available to us, and not reinvent the wheel.

Method summaries (or method menu or method restaurant) are simply a listing of methods for a given object type (class).

They are common in object languages. Here is a Java example for String -- look at "method summary" section.

They are highly valuable for reusing code. We don't have time to scan code. This provides a "menu of methods" with just summaries like a restaurant has a listing of food choice summaries. We can then scan the method menu and choose the method(s) that suit are taste (and logic needs).

Remember -- we can also call the object we are coding in (so also keep those method summaries handy).

See The Disappearing Code Blob Magic Trick
A "no-args" constructor is a constructor that simply takes no arguments (parameters). Examples are shown below.

The implementation of a "no-args" constructor varies per the programming language but is simply an implementation where the constructor method would have no method parameters.
//Examples of using a "no-args" constructor

//Given object type (class) Foo
//Construct object using "no-args" constructor
let myFoo = new Foo();

//Given object type (class) SillyPutty
//Construct object using "no-args" constructor
let sp = newSillyPutty();